* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <xen/config.h>
+#include <xen/iocap.h>
#include <xen/lib.h>
#include <xen/sched.h>
#include <xen/shadow.h>
guest_handle_cast(uop, gnttab_map_grant_ref_t);
if ( unlikely(!guest_handle_okay(map, count)) )
goto out;
+ rc = -EPERM;
+ if ( unlikely(!grant_flip_permitted(d)) )
+ goto out;
rc = gnttab_map_grant_ref(map, count);
break;
}
guest_handle_cast(uop, gnttab_unmap_grant_ref_t);
if ( unlikely(!guest_handle_okay(unmap, count)) )
goto out;
+ rc = -EPERM;
+ if ( unlikely(!grant_flip_permitted(d)) )
+ goto out;
rc = gnttab_unmap_grant_ref(unmap, count);
break;
}
guest_handle_cast(uop, gnttab_transfer_t);
if ( unlikely(!guest_handle_okay(transfer, count)) )
goto out;
+ rc = -EPERM;
+ if ( unlikely(!grant_flip_permitted(d)) )
+ goto out;
rc = gnttab_transfer(transfer, count);
break;
}
#define multipage_allocation_permitted(d) \
(!rangeset_is_empty((d)->iomem_caps))
+/*
+ * Until TLB flushing issues are sorted out we consider it unsafe for
+ * domains with no hardware-access privileges to perform grant map/transfer
+ * operations.
+ */
+#define grant_operations_permitted(d) \
+ (!rangeset_is_empty((d)->iomem_caps))
+
#endif /* __XEN_IOCAP_H__ */